package com.ruoyi.business.controller;
 
import com.ruoyi.business.domain.LpClassify;
import com.ruoyi.business.service.LpClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Objects;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
 import java.util.List;
/**
 * @Author makejava
 * @Desc (LpClassify)表控制层
 * @Date 2024-05-14 10:28:18
 */
@Api(tags = "")
@RestController
@RequestMapping("lpClassify")
public class LpClassifyController extends BaseController{
 
    @Autowired
    private  LpClassifyService lpClassifyService;
    
    @ApiOperation("列表查询")
    @GetMapping("/list")
    public TableDataInfo getList(LpClassify lpClassify) {
         startPage();
         List<LpClassify> list=lpClassifyService.queryAll(lpClassify);
         return getDataTable(list);
    }
    
    @ApiOperation("-根据ID查详情")
    @GetMapping(value = "/{id}")
    public AjaxResult queryById(@PathVariable("id") Long id) {
        return AjaxResult.success(lpClassifyService.queryById(id));
    }
 
 
    @ApiOperation("-新增数据")
    @PostMapping("/insert")
    public AjaxResult insert(@RequestBody LpClassify lpClassify) {
        lpClassify.setCreateBy(getUsername());
        return toAjax(lpClassifyService.insert(lpClassify));
    }
 
 
    @ApiOperation("-编辑数据")
    @PutMapping("/update")
    public AjaxResult update(@RequestBody LpClassify lpClassify) {
        return toAjax(lpClassifyService.update(lpClassify));
    }
 
 
    @ApiOperation("-删除数据")
    @DeleteMapping("/{id}")
    public AjaxResult deleteById(@PathVariable("id") Long id) {
        return toAjax(lpClassifyService.deleteById(id));
    }
    
    /**
     * 通过主键批量删除
     */
    @ApiOperation(value = "批量删除")
    @DeleteMapping("/remove/batch/{classifyIds}")
    public AjaxResult batchRemove(@PathVariable("classifyIds") Long[] classifyIds){    
        return AjaxResult.success(lpClassifyService);
    }
 
}

